package com.accompany.adapter;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import com.accompany.fragment.my.fragment.TrainingCenterOfflineFragment;
import com.accompany.fragment.my.fragment.TrainingCenterOnlineFragment;
import java.util.List;

/**
 * 信息说明: 培训中心适配器
 * company: 兰州丰荣信息科技有限公司
 * 创建时间: on 2022/3/17 16 ：35
 * 项目名称：yuanban
 */
public class TrainingCenterAdapter  extends FragmentPagerAdapter {
    private List<Fragment> fmList;

    public TrainingCenterAdapter(FragmentManager fragmentManager, List<Fragment> list) {
        super(fragmentManager);
        fmList = list;
    }
    @Override
    public Fragment getItem(int arg0) {
        if (arg0 == 0) {
            return new TrainingCenterOnlineFragment();
        } else if (arg0 == 1) {
            return new TrainingCenterOfflineFragment();
        }
        return null;
    }
    @Override
    public int getCount() {
        return fmList.size();
    }
    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {}
}

